The present invention relates to a packet transmitting/receiving apparatus for transmitting and receiving packets using a transmission medium, and also relates to a packet receiving apparatus.
For digital data transmission and reception, communication is usually performed using packets as units. When a transmitting device transmits a packet, a receiving device receives the packet and takes out data carried in the packet. In such data communications using packets as units, when a packet is received the receiving device may return an acknowledge (hereinafter designated as ACK) indicating the status of the received packet to the transmitting device, to enhance communication reliability. This ACK includes an error occurrence state during transmission, the condition of the receiving device, etc. as well as information indicating whether or not a retransmission is necessary.
One of the interfaces that perform such packet communication is the IEEE 1394 interface. IEEE 1394 is the next-generation high-speed serial interface for multimedia, standardized by IEEE (refer to High Performance Serial Bus P1394/Draft 8.0v2). Currently, development is under way to use this IEEE 1394 for digital A/V equipment.
IEEE 1394 provides two types of packet transport modes: isochronous packet transport mode for the transport of data that needs real-time transmission, and asynchronous packet transport mode for the transport of data, such as a control command, etc., that does not need real-time transmission. Of these mode, in the transport of normal asynchronous packets, the receiving device returns an ACK to the transmitting device for each received packet. using this ACK, the receiving device can request a retransmission. On the other hand, for special asynchronous packets used for transmission to all the devices connected to the same interface, an ACK cannot be sent. In this case, none of the receiving devices can request a retransmission.
In IEEE 1394, there are two kinds of asynchronous packets: a request packet transmitted to request an action and a response packet transmitted to return the result of the action requested by the request packet. In either case, when a packet is received, an ACK is returned to the transmitting device. These two kinds of packets are usually used as a pair, except the case where processing is completed by returning an ACK to a request packet.
FIG. 1 shows a sequence diagram illustrating the case where a first device 1 transmits a request packet to a second device 2. When the first device 1 sends a request packet to the second device 2, the second device 2, upon receiving the packet, returns an ACK to the first device 1. The ACK in this case can indicate a retransmission request, completion of reception (request being processed), completion of processing, etc. When the ACK indicates a retransmission request, the first device 1 retransmits the request packet, as shown in FIG. 1. When ACK indicates the completion of the reception, this means that the second device 2 is processing the request, so that the first device 1 waits until the corresponding response packet is returned. When the ACK indicates the completion of processing, transmission of a response packet is not performed.
On the other hand, after transmitting the ACK indicating the completion of the reception, the second device 2 transmits to the first device 1 a response packet carrying the result of the processing requested by the request packet. Upon receiving the response packet, the first device 1 sends an ACK indicating a retransmission request or completion of processing. In this case also, if the ACK indicates a retransmission request, the second device 2 retransmits the response packet. Note here that since the response packet is not a packet requesting processing, an ACK indicating the completion of reception (request being processed) cannot be used.
In IEEE 1394, transmission and reception of a request packet and a response packet are performed as described above. However, in the case of the previously mentioned special request packets transmitted to all the devices connected to the same interface, ACKs are not transmitted.
IEEE 1394 specifies a timeout interval for detecting an interruption of processing during communications using such request and response packets. More specifically, when a request packet is transmitted, if a response packet is not received within a predefined time after receiving an ACK indicating the completion of the reception, then it is determined that the processing requested by the request packet has been interrupted because of some failure. The device that transmitted the request packet can then proceed to the next processing. On the other hand, the device that received the request packet must send a response packet within the predefined time. The default value of this predefined time is 100 ms, and the time setting can be changed arbitrarily.
On the other hand, IEEE 1394 provides a counter of about 25 MHZ, called a cycle time register, synchronized in all devices. As a function of the interface, it is guaranteed that the counter value is the same for all the devices. Therefore, the cycle time register can be used as a clock in the IEEE 1394 interface.
In IEEE 1394, where processing is performed using the request/response packet pair, there is a possibility that while waiting for a response packet after sending a request packet, a request packet or the like may arrive from another device. This necessitates increasing the capacity of a packet receiving buffer so that a plurality of packets can be received. Further, if the packet receiving buffer cannot be used because a new request packet has been received, an ACK indicating a retransmission request for a response packet will have to be transmitted. Because of such a retransmission request, a timeout may occur, interrupting the processing. Such interruption of the processing can significantly reduce communication reliability.
Furthermore, since the processing of a response packet cannot be carried out while processing the new request packet, an ACK requesting a retransmission will be returned in reply to the received response packet. In this case also, an interruption of processing may occur, as in the above case. Therefore, there has been a need for a packet transmitting/receiving apparatus that can receive a response packet reliably without causing an interruption in processing.
Further, while waiting for the expected response packet, if a new request packet is received from another device, multiple processes that require servicing will occur simultaneously. Accordingly, all devices are required to have the capability to carry out multiple processes, the resulting problem being that the processing and configuration of each device increase in complexity.
On the other hand, in IEEE 1394, a special type of packet may be used that is sent to all the devices connected to the same interface. This special type of packet is primarily used when transmitting important information, for example, to manage the entire interface. For this special type of packet, however, a retransmission request cannot be made using an ACK. As a result, when the packet receiving buffer cannot be used because it is used for other packets, for example, the special packet cannot be received. This degrades the reliability of the entire interface, and can render correct packet reception and transmission impossible.
As earlier stated, in IEEE 1394, the maximum time interval between the transmission of a request packet and the transmission of a response packet is predefined. If the corresponding response packet is not received within the predefined time, the device that sent the request packet determines that the processing has been interrupted. On the other hand, the device that received the request packet must send a response packet within the predefined time interval, but there can be cases where the device is unable to send a response packet within the predefined time, depending on the condition of the device.
In that case, if the device sends a response packet after the predefined time has elapsed, the packet thus sent is not only wasted but can interfere with the transmission of other valid packets.
Considering such conventional problems, the object of the present invention is to realize a packet transmitting/receiving apparatus for transmitting and receiving a transmitting packet and a response packet without fail using a transmission medium, and a packet receiving apparatus for receiving a request packet.
To solve such problems, one aspect of the present invention (according to claim 1) is a packet transmitting/receiving apparatus comprising packet transmitting means for transmitting a packet; packet receiving means for receiving and outputting a packet; and reception control means for controlling the operation of said packet receiving means on the basis of the packet transmitted by said packet transmitting means.
Another aspect of the present invention (according to claim 2) is a packet transmitting/receiving apparatus, wherein said reception control means performs control so as not to receive any packet other than a response packet corresponding to the request packet transmitted by said packet transmitting means.
Still another aspect of the present invention (according to claim 3) is a packet transmitting/receiving apparatus, wherein said reception control means performs control so as not to receive any packet other than a response packet corresponding to the request packet transmitted by said packet transmitting means, during a time interval between the transmission of said request packet and the reception of said response packet.
A further aspect of the present invention is a packet transmitting/receiving apparatus, wherein said reception control means performs control so as not to receive any packet other than a response packet corresponding to the request packet transmitted by said packet transmitting means, until said response packet is received within a predefined time after the transmission of said request packet.
A still further aspect of the present invention is a packet transmitting/receiving apparatus comprising packet transmitting means for transmitting a packet; packet receiving means for receiving and outputting a packet; prediction means for predicting, based on the request packet transmitted by said packet transmitting means, packet identification information of a response packet corresponding to said request packet, and for outputting said predicted identification information; and comparing means for comparing said predicted identification information supplied from said prediction means with received identification information of the received packet supplied from said packet receiving means, and for outputting said received packet only when said received packet is the packet corresponding to said response packet.
Still another aspect of the present invention is a packet transmitting/receiving apparatus, wherein said comparing means discards said predicted identification information unless said response packet is received within a predefined time after said request packet is transmitted by said packet transmitting means.
A still further aspect of the present invention is a packet transmitting/receiving apparatus comprising packet receiving means for receiving and outputting a packet; normal packet accumulating means for temporarily accumulating a packet for which a retransmission request can be made; particular packet accumulating means for temporarily accumulating a packet for which a retransmission request cannot be made; packet selecting means for receiving the received packet from said packet receiving means, and writing said received packet either to said normal packet accumulating means or to said particular packet accumulating means, depending on whether or not said received packet is a packet for which a retransmission request can be made, and for directing a retransmission of said received packet when said received packet is a packet for which a retransmission request can be made, and when said packet is received while said normal packet accumulating means is in use; and retransmission requesting means for requesting a retransmission of said packet based on the direction of said packet selecting means.
A further aspect of the present invention is a packet transmitting/receiving apparatus , wherein when a packet for which a retransmission request can be made is received from said packet receiving means, and when directing a retransmission of said received packet, said packet selecting means discards said received packet.
A still further aspect of the present invention is a packet transmitting/receiving apparatus, wherein when a packet for which a retransmission request cannot be made is received from said packet receiving means, and when said exception packet accumulating means is in use, said packet selecting means discards said received packet.
An additional aspect of the present invention is a packet transmitting/receiving apparatus comprising packet receiving means for receiving and outputting a packet packet accumulating means for temporarily accumulating the received packet received by said packet receiving means; time outputting means for outputting a time; receive time holding means for accepting said time from said time outputting means, and for holding a write time at which said received packet was written to said packet accumulating means by said packet receiving means; response packet generating means for, when said received packet needs a response packet corresponding thereto, generating said response packet based on said received packet accumulated in said packet accumulating means, said write time held in said receive time holding means, and said time output from said time outputting means, and outputting said generated response packet; and packet transmitting means for transmitting said response packet.
Still an additional aspect of the present invention is a packet transmitting/receiving apparatus, wherein said response packet generating means outputs said response packet only when the time input from said time outputting means when outputting said response packet is earlier than a time obtained by adding a predetermined value to said write time.
Still another aspect of the present invention is a packet transmitting/receiving apparatus comprising packet receiving means for receiving and outputting a packet;,packet accumulating means for temporarily accumulating the received packet received by said packet receiving means; time outputting means for outputting a time; receive time holding means for accepting said time from said time outputting means, and for holding a write time at which said received packet was written to said packet accumulating means by said packet receiving means; response packet generating means for, when said received packet needs a response packet corresponding thereto, generating said response packet by reading out said received packet accumulated in said packet accumulating means and said write time held in said receive time holding means, and outputting said generated response packet and said write time; and packet transmitting means for accepting said time from said time outputting means and said response packet and said write time from said response packet generating means, and for transmitting said response packet only when the time at which the transmission is made is not later than a time obtained by adding a predetermined value to said write time.
A further aspect of the present invention is a packet transmitting/receiving apparatus comprising packet receiving means for receiving and outputting a packet; packet accumulating means for temporarily accumulating the received packet received by said packet receiving means; time outputting means for outputting a time; measuring means for accepting said time from said time outputting means, and for measuring and outputting a time elapsed after said received packet was written to said packet accumulating means by said packet receiving means; response packet generating means for, when said received packet needs a response packet corresponding thereto, generating said response packet based on said received packet accumulated in said packet accumulating means and said elapsed time output from said measuring means, and outputting said generated response packet; and packet transmitting means for transmitting said response packet.
A still further aspect of the present invention is a packet transmitting/receiving apparatus, wherein said response packet generating means outputs said response packet only when said elapsed time is less than a predetermined value.
A still further aspect of the present invention is a packet receiving apparatus comprising packet receiving means for receiving and outputting a packet; packet accumulating means for temporarily accumulating the received packet received by said packet receiving means; time outputting means for outputting a time; measuring means for accepting said time from said time outputting means, and for measuring and outputting a time elapsed after said received packet was written to said packet accumulating means by said packet receiving means; and elapsed time monitoring means for, when said packet needs a response packet corresponding thereto, monitoring said elapsed time being output from said measuring means and, if said elapsed time exceeds a predefined time, discarding said received packet accumulated in said packet accumulating means.
In one aspect of the invention, when the packet transmitting means transmits a request packet, the packet receiving means waits to receive a packet. At this time, if the received packet from the transmission medium is the response packet indicated by the control information from the reception control means, this packet is received and output to the outside.
In another aspect of the invention, when the packet transmitting means transmits a request packet, the packet receiving means waits to receive a packet. Based on the transmitted request packet, the prediction means predicts the packet identification information of the response packet corresponding to the request packet. The comparing means identifies whether the received packet is the response packet corresponding to the request packet by comparing the predicted identification information supplied from the prediction means with the received identification information of the received packet supplied from the packet receiving means, and outputs the received packet to the outside only when the result of the comparison is affirmative.
In still another aspect of the invention, the normal packet accumulating means temporarily accumulates a packet for which a retransmission request can be made, and the particular packet accumulating means temporarily accumulates a packet for which a retransmission request cannot be made. The packet selecting means receives the received packet from the packet receiving means, and writes the receives packet either to the normal packet accumulating means or to the particular packet accumulating means, depending on whether or not the received packet is a packet for which a retransmission request can be made. Further, when a packet for which a retransmission request can be made is received while the normal packet accumulating means is in use, the retransmission requesting means directs a retransmission of the received packet based on the direction of the packet selecting means.
In yet another aspect of the invention, the packet accumulating means temporarily accumulates the received packet received by the packet receiving means. When the time is input from the time outputting means, the receive time holding means holds the time at which the received packet was written to the packet accumulating means by the packet receiving means. When the received packet needs a response packet corresponding thereto, the response packet generating means generates the response packet based on the received packet accumulated in the packet accumulating means, the write time held in the receive time holding means, and the time output from the time outputting means, and outputs the thus generated response packet.
In a still further aspect of the invention, the packet accumulating means temporarily accumulates the received packet received by the packet receiving means. When the time is input from the time outputting means, the receive time holding means holds the time at which the received packet was written to the packet accumulating means by the packet receiving means. When the received packet needs a response packet corresponding thereto, the response packet generating means generates the response packet by reading out the received packet accumulated in the packet accumulating means and the write time held in the receive time holding means, and outputs the thus generated response packet and the write time. The packet transmitting means accepts the time from the time outputting means and the response packet and write time from the response packet generating means, and transmits the response packet only when the time at which the transmission is made is not later than a time obtained by adding a predetermined value to the write time.
In an additional aspect of the invention, the packet accumulating means temporarily accumulates the received packet received by the packet receiving means. When the time is input from the time outputting means, the measuring means measures the time elapsed after the received packet was written to the packet accumulating means by the packet receiving means. When the received packet needs a response packet corresponding thereto, the response packet generating means generates the response packet based on the receive packet accumulated in the packet accumulating means and the elapsed time output from the measuring means, and outputs the thus generated response packet.
In still an additional aspect of the invention, the packet accumulating means temporarily accumulates the received packet received by the packet receiving means. When the time is input from the time outputting means, the measuring means measures the time elapsed after the received packet was written to the packet accumulating means by the packet receiving means. When the received packet needs a response packet corresponding thereto, the elapsed time monitoring means monitors the time being output from the measuring means and, if the elapsed time exceeds a predefined time, discards the received packet accumulated in the packet accumulating means.